<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
    <style>
        table,
        td,
        th {
            border: 2px solid rgb(242, 249, 236);
            border-collapse: collapse;
        }

        table td {
            padding: 18px 50px;
        }

        .a {
            border-style: groove;
            background-color: aliceblue;
        }

        .t1 {
            background-color: #11eaa1;
        }

        .t2 {
            background-color: #ffb6c1;
        }

        .t3 {
            height: 250px;
            background-color: #18d8ee;
        }
    </style>
</head>

<body>
    <div id="app">
        <mycom :msg="msg" @my-event="gzf"></mycom>
    </div>
    <script>
        var ti_me = new Date().toLocaleString();
        var component1 = {
            props: ['msg'],
            data() {
                return {
                    commsg: ''
                }
            },
            template: `
            <div>
            <div>
                <div><table class="t1">
                    <tr><td class="t1"><strong>图书馆人流量</td><td class="t2"><a class="a">年</a><a class="a">月</a><a class="a">日</a></td></tr>
                    <tr class="t3"><td colspan="2">对组件的封装现实生活中总有很多地方要实现对组件的复用<br>现封装一个组件来显示图表内容</tr>
                    </table></div>
            </div>
        </div> 
        `,
            methods: {
                asd() {
                    this.$emit('my-event', this.commsg)
                }
            }
        }
        var vm = new Vue({
            el: '#app',
            data: {
                time: ti_me
            },
            methods: {

            },
            components: {
                'mycom': component1
            }
        })
    </script>
</body>
</html>